package com.raft.core.node.store;

import javax.annotation.Nullable;

import com.raft.core.node.NodeId;

/**
 * Node store.
 */
public interface NodeStore {

    /**获取currentTerm
     * @return term
     */
    int getTerm();

    /**设置currentTerm
     * @param term term
     */
    void setTerm(int term);

    /**获取votedFor
     * @return voted for
     */
    @Nullable
    NodeId getVotedFor();

    /**设置votedFor
     * @param votedFor voted for
     */
    void setVotedFor(@Nullable NodeId votedFor);

    /**关闭文件
     */
    void close();

}
